//
//  HLBaseData.m
//  TestJSPay
//
//  Created by hongliang on 16/3/26.
//  Copyright © 2016年 hongliang. All rights reserved.
//

#import "HLBaseData.h"

@implementation HLBaseData
+ (NSString*)stringValue:(id)obj defaultValue:(NSString*)defaultValue{
    if (!obj) {
        return defaultValue;
    }
    
    if ([obj isKindOfClass:[NSNull class]] || [self isEqual:[NSNull null]]) {
        return @"";
    }
    
    if ([obj isKindOfClass:[NSString class]]) {
        NSString* strValue = obj;
        if (strValue.length <= 0) {
            return defaultValue;
        }
        
        if ([strValue isEqualToString:@"<null>"]) {
            return @"";
        }
        if ([strValue isEqualToString:@"(null)"]) {
            return @"";
        }
        
        return strValue;
    }else {
        return [NSString stringWithFormat:@"%@",obj];
    }
}

+ (id)parseObjectFormJsonObject:(id)jsonObject {
    return nil;
}

- (void)setValue:(id)value forUndefinedKey:(NSString *)key {
    NSLog(@"Undefined Key is %@", key);
}
@end
